package WrittenTest;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class test6 {
    // 杨辉三角
    public static void main(String[] args) {
        List<ArrayList<Integer>> lists = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 0; i < n; i++) {
            ArrayList<Integer> list = new ArrayList<>();
            for (int j = 0; j <= i; j++) {
                // 每一行的首尾元素都是 1
                if (j == 0 || j == i) {
                    list.add(1);
                } else {
                    list.add(lists.get(i - 1).get(j - 1) + lists.get(i - 1).get(j));
                }
            }
            lists.add(list);
        }
        for (int i = 0; i < lists.size(); i++) {
            for (int j = 0; j <= i; j++) {
                System.out.printf("%5d", lists.get(i).get(j));
            }
            System.out.println();
        }
    }
}
